package com.wanglei.rdd.create

import org.apache.spark.{SparkConf, SparkContext}

object Spark03_rdd_partition {

  def main(args: Array[String]): Unit = {
    //
    val conf = new SparkConf().setMaster("local[1]").setAppName("rdd")
    val sc = new SparkContext(conf)

    //
    val seq = Seq[Int](1, 2, 3, 4)

    // [1,2] [3,4]
    // val rdd = sc.makeRDD(seq, 2)

    // [1] [2] [3,4]
    val rdd = sc.makeRDD(seq, 3)

    rdd.saveAsTextFile("output")

    //
    sc.stop()
  }
}
